public class InnerClass {
    public static void main(String[] args) {
        class A{
            public void fun(){
                System.out.println("局部内部类");
            }
        }
        A a  = new A();
        a.fun();
    }
    public static void main1(String[] args) {
        Outer.Inner inner = new Outer.Inner();
        inner.fun();
    }
}
class Outer{
    public int age = 11;
    public static String name = "lisi";
    public static void fun1(){
        System.out.println("调用外部类的方法");
    }
    //内部类
    static public class Inner{
        public int age = 14;
        public void fun(){
            System.out.println(name);
            fun1();
            System.out.println("调用内部类的方法");
        }
    }
}



//外部类
/*class Outer{
    public int age = 11;

    public void fun(){
        System.out.println("调用外部类的方法");
    }

    //内部类
    public class Inner{
        public int age = 14;
        public void fun(){
            System.out.println(Outer.this.age);
            Outer.this.fun();
            System.out.println("调用内部类的方法");
        }
    }
}*/

//外部类